<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>for swap half</title>
    <script>
        (function (array) {
            var left = null;
            var right = null;
            var length = array.length;
            for (left = 0; left < length / 2; left += 1){
                right = length - 1 - left;
                var temporary = array[left];
                array[left] = array[right];
                array[right] = temporary;
            }
            console.log(array.join(""));
        })("字符倒序测试.".split(""));
    </script>
</head>

<body>

</body>

</html>